TABLENN n/a   IE 4   DOM 1

The TABLE object reflects the TABLE element. Other objects related to the TABLE object are: CAPTION, COL, COLGROUP, TBODY, TD, TFOOT, THEAD, and TR.

 
HTML Equivalent
<TABLE>
 
Object Model Reference
IE [window.]document.all.elementID
alignNN n/a   IE 4   DOM 1
 Read/Write
 

Defines the horizontal alignment of the element within its surrounding container.

 
Example
document.all.myTable.align = "center"
 
Value
Any of the three horizontal alignment constants: center | left | right.
 
Default left
backgroundNN n/a   IE 4   DOM n/a
 Read/Write
 

URL of the background image for the table. If you set a backgroundColor to the element as well, the color appears if the image fails to load; otherwise, the image overlays the color.

 
Example
document.all.myTable.background = "images/watermark.jpg"
 
Value
Complete or relative URL to the background image file.
 
Default None.
bgColorNN n/a   IE 4   DOM 1
 Read/Write
 

Background color of the element. This color setting is not reflected in the style sheet backgroundColor property. Even if the BGCOLOR attribute or bgColor property is set with a plain-language color name, the returned value is always a hexadecimal triplet.

 
Example
document.all.myTable.bgColor = "yellow"
 
Value
A hexadecimal triplet or plain-language color name.
 
Default Varies with browser and operating system.
borderNN n/a   IE 4   DOM 1
 Read/Write
 

Thickness of the border around the table (in pixels). This is the 3-D border and should not be confused with borders created with style sheets.

 
Example
document.all.myTable.border = 4
 
Value
An integer value. A setting of zero removes the border entirely in Internet Explorer 4.
 
Default 0
borderColorNN n/a   IE 4   DOM n/a
 Read/Write
 

Color of the table's border. Internet Explorer applies the color to all four lines that make up the interior border of a cell. Therefore, colors of adjacent cells do not collide.

 
Example
document.all.myTable.borderColor = "salmon"
 
Value
A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black).
 
Default Varies with operating system.
borderColorDark, borderColorLightNN n/a   IE 4   DOM n/a
 Read/Write
 

The 3-D effect of table borders in Internet Explorer is created by careful positioning of light and dark lines around the page's background or default color. You can independently control the colors used for the dark and light lines by assigning values to the borderColorDark (left and top edges of the cell) and borderColorLight (right and bottom edges) properties.

Typically, you should assign complementary colors to the pair of properties. There is also no rule that says you must assign a dark color to borderColorDark. The attributes merely control a well-defined set of lines so you can predict which lines of the border change with each attribute.

 
Example
document.all.myTable.borderColorDark = "blue"
document.all.myTable.borderColorLight = "cornflowerblue"
 
Value
A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black).
 
Default Varies with operating system.
captionNN n/a   IE 4   DOM
 Read-only
 

Returns a reference to a CAPTION element nested inside the table. From this reference you can access properties and methods of the CAPTION object. This property is available only in the Win32 version of Internet Explorer 4.

 
Example
var capText = document.all.myTable.caption.innerHTML
 
Value
Object reference.
 
Default None.
cellPaddingNN n/a   IE 4   DOM 1
 Read/Write
 

The amount of empty space between the border of a table cell and the content of the cell. Note that this property applies to space inside a cell. Minor adjustments to this property are not as noticeable when the table does not also display borders (in which case the cellSpacing property can assist in adjusting the space between cells).

 
Example
document.all.myTable.cellPadding = "15"
 
Value
A string value for a length in a variety of units or percentage.
 
Default 0
cellSpacingNN n/a   IE 4   DOM 1
 Read/Write
 

The amount of empty space between the outer edges of each table cell. If the table has a border, the effect of setting cellSpacing is to define the thickness of borders rendered between cells. Even without a visible border, the readability of a table often benefits from cell spacing.

 
Example
document.all.myTable.cellSpacing = "5"
 
Value
A string value for a length in a variety of units or percentage.
 
Default 0 (with no table border); 2 (with table border).
clientHeight, clientWidthNN n/a   IE 4   DOM n/a
 Read/Write
 

According to Microsoft's developer documentation, these properties reflect the height and width (in pixels) of the element's content.

 
Example
var midHeight = document.all.myTable.clientHeight/2
 
Value
Integer pixel value.
 
Default None.
colsNN n/a   IE 4   DOM 1
 Read/Write
 

The number of columns of the table. The corresponding COLS attribute assists the browser in preparation for rendering the table. Without this attribute, the browser relies on its interpretation of all downloaded TR and TD elements to determine how the table is to be divided.

 
Example
document.all.myTable.cols = 5
 
Value
Any positive integer.
 
Default None.
dataFldNN n/a   IE 4   DOM n/a
 Read/Write
 

Used with IE 4 data binding to associate a remote data source column name with individual TD elements inside the table. A DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source.

 
Example
document.all.inventoryTable.dataFld = "unit_price"
 
Value
Case-sensitive identifier of the data source column.
 
Default None.
dataPageSizeNN n/a   IE 4   DOM n/a
 Read/Write
 

Used with IE 4 data binding, this property advises the browser how many instances of a table row must be rendered to accommodate the number of data source records set by this attribute. See nextPage( ) and previousPage( ) methods for navigating through groups of records.

 
Example
document.all.inventoryTable.dataPageSize = 10
 
Value
Positive integer.
 
Default None.
dataSrcNN n/a   IE 4   DOM n/a
 Read/Write
 

Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Content from the data source is specified via the DATAFLD attribute in individual TD elements. A block of contiguous records can be rendered in the table when you also set the DATAPAGESIZE attribute of the table. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source.

 
Example
document.all.inventoryTable.dataSrc = "#DBSRC3"
 
Value
Case-sensitive identifier of the data source.
 
Default None.
frameNN n/a   IE 4   DOM 1
 Read/Write
 

Which (if any) sides of a table's outer border (set with the BORDER attribute or border property) are rendered. This property does not affect the interior borders between cells.

 
Example
document.all.orderForm.frame = "hsides"
 
Value
Any one case-insensitive frame constant (as a string):
above Renders border along top edge of table only
below Renders border along bottom edge of table only
border Renders all four sides of the border (default in IE)
box Renders all four sides of the border (same as border)
hsides Renders borders on top and bottom edges of table only (a nice look)
lhs Renders border on left edge of table only
rhs Renders border on right edge of table only
void Hides all borders (default in HTML 4.0)
vsides Renders borders on left and right edges of table only
 
Default void (when BORDER=0); border (when BORDER is any other value)
height, widthNN n/a   IE 4   DOM n/a
 Read/Write
 

The height and width in pixels of the element. Changes to these values are immediately reflected in reflowed content on the page.

 
Example
document.all.myTable.height = 250
 
Value
Integer.
 
Default None.
recordNumberNN n/a   IE 4   DOM n/a
 Read-only
 

Used with data binding, returns an integer representing the record within the data set that generated the element (e.g., a TABLE element whose content is filled via data binding). Values of this property can be used to extract a specific record from an Active Data Objects (ADO) record set.

 
Example
<SCRIPT FOR="tableTemplate" EVENT="onclick">
    myDataCollection.recordset.absoluteposition = this.recordNumber
    ...
</SCRIPT>
 
Value
Integer.
 
Default None.
rulesNN n/a   IE 4   DOM 1
 Read/Write
 

Where (if at all) interior borders between cells are rendered by the browser. In addition to setting the table to draw borders to turn the cells into a matrix, you can set borders to be drawn only to separate borders, columns, or any sanctioned cell grouping (THEAD, TBODY, TFOOT, COLGROUP, or COL). The BORDER attribute must be present--either as a Boolean or set to a specific border size--for any cell borders to be drawn. Do not confuse this property with the rules[] collection of styleSheet objects.

 
Example
document.all.myTable.rules = "groups"
 
Value
Any one case-insensitive rules constant (as a string):
all Renders borders around each cell
cols Renders borders between columns only
groups Renders borders between cell groups as defined by THEAD, TFOOT, TBODY, COLGROUP, or COL elements
none Hides all interior borders
rows Renders borders between rows only
 
Default None (when BORDER=0); all (when BORDER is any other value).
scrollHeight, scrollWidthNN n/a   IE 4   DOM n/a
 Read-only
 

The meaning of these two properties is ambiguous based on Microsoft's description and the way they're implemented in the Windows and Macintosh versions of Internet Explorer 4. My best guess is that these properties are intended to measure the height and width (in pixels) of the content of an element even when some of the content cannot be seen unless scrolled with scrollbars. The Macintosh version of the browser interprets this to mean the amount of the content that you can see at any one time. The important point is that for key elements, such as the BODY, the properties mean different things and can disrupt cross-platform operation.

 
Example
var midPoint = document.all.myTable.scrollHeight/2
 
Value
Positive integer or zero.
 
Default None.
scrollLeft, scrollTopNN n/a   IE 4   DOM n/a
 Read/Write
 

The distance in pixels between the actual left or top edge of the element's physical content and the left or top edge of the visible portion of the content. Setting these properties allows you to use scripts to adjust the scroll of content within a scrollable container, such as text in a TEXTAREA element or an entire document in the browser window or frame. When the content is not scrolled, both values are zero. Setting the scrollTop property to 15 scrolls the document upward by 15 pixels in the window; the scrollLeft property is unaffected unless explicitly changed. The property values change as the user adjusts the scrollbars.

 
Example
document.all.myTable.scrollTop = 40
 
Value
Positive integer or zero.
 
Default 0
tabIndexNN n/a   IE 4   DOM 1
 Read/Write
 

A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether.

Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields.

 
Example
document.all.myTable.tabIndex = 6
 
Value
Integer.
 
Default None.
tFootNN n/a   IE 4   DOM n/a
 Read-only
 

Returns a reference to the TFOOT object if one has been defined for the table. If no TFOOT element exists, the value is null. You can access TFOOT element properties and methods through this reference if you like. This property is available only on the Win32 version of Internet Explorer 4.

 
Example
var tableFootTxt = document.all.myTable.tFoot.innerText
 
Value
TFOOT object reference.
 
Default null
tHeadNN n/a   IE 4   DOM n/a
 Read-only
 

Returns a reference to the THEAD object if one has been defined for the table. If no THEAD element exists, the value is null. You can access THEAD element properties and methods through this reference if you like. This property is available only on the Win32 version of Internet Explorer 4.

 
Example
var tableHeadTxt = document.all.myTable.tHead.innerText
 
Value
THEAD object reference.
 
Default null
blur( )NN n/a   IE 4   DOM n/a

Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result.

 
Returned Value
None.
 
Parameters
None.
focus( )NN n/a   IE 4   DOM n/a

Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event.

 
Returned Value
None.
 
Parameters
None.
nextPage( ), previousPage( )NN n/a   IE 4   DOM n/a

Advises the data binding facilities to load the next or previous group of records from the data source to fill the number of records established with the dataPageSize property.

 
Returned Value
None.
 
Parameters
None.
refresh( )NN n/a   IE 4   DOM n/a

Advises the data binding facilities to reload the current page of data from the data source. If your table is retrieving frequently changing data from a database, you can create a setTimeout( ) loop to invoke document.all.myTable.refresh( ) as often as users would want updated information from the database.

 
Returned Value
None.
 
Parameters
None.
rows( )NN n/a   IE 4   DOM n/a

An array of all rows of the table. This collection includes all individual rows from row groups (THEAD, TBODY, and TFOOT elements) in the table.

 
Syntax
document.all.myTable.rows(i).objectPropertyOrMethod
tBodies[ ]NN n/a   IE 4   DOM n/a

A collection of TBODY objects on the table. By default, there is at least one TBODY object, even if none is explicitly created with an HTML tag. You can access properties and methods of each TBODY object through this reference if you like. But if you also specify an explicit TBODY element, you can go directly to the element via its ID. This collection is available only on the Win32 version of Internet Explorer 4.

 
Syntax
document.all.myTable.tBodies(i).objectPropertyOrMethod